<!-- :style="`text-align: center;background: url(${item.img}) 0 0 no-repeat;background-size: 100% 100%`" -->
<template>
	<view class="container">
		<top-back-navbar position="fixed" :title="navTitle" background="#ffffff" color="#000000"></top-back-navbar>
		<view class="list_box">

			<view class="item" v-for="item,index in data_list" @click="to_detail(item)">
				<view class="bgi_box" style=" ">
					<image
						:src="item.thumb"
						mode=""></image>
				</view>


				<view class="content_box">
					<view class="row1">
						{{item.title}}
					</view>
					<view class="row2">
						<view class="">
							<view class="">
								积分值:
							</view>
							<view class="">
								{{item.jfz}}
							</view>
						</view>
						<view class="">
							<view class="">
								PV值:
							</view>
							<view class="">
								{{item.pv}}
							</view>
						</view>
					</view>
					<view class="row3">
						<view class="">
							<view class="">
								贝值:
							</view>
							<view class="">
								{{item.bz}}
							</view>
						</view>
						<view class="">
							<view class="">
								股值:
							</view>
							<view class="">
								{{item.tzz}}
							</view>
						</view>
					</view>
					<view class="row4">
						<view class="">
							库存:
						</view>
						<view class="">
							{{item.total}}件
						</view>
					</view>
					<view class="row5">
						<view class="price">
							{{item.marketprice}}
						</view>
						<view class="buy_button">
							立即购买
						</view>
					</view>
				</view>


			</view>

		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				openid: '',
				cate: '',
				keywords: '',
				pageType: '',
				navTitle: '',
				data_list:[]
			}
		},
		onLoad: function(e) {
			this.cate = e.cate || ''

			this.keywords = e.keywords || '';
			this.pageType = e.type || '1';
			if (this.pageType == 1) {
				this.navTitle = '商品列表';
				this.getdata()
			} else if (this.pageType == 2) {
				this.navTitle = '商品列表';
				this.searchData()
			}
		},
		onReachBottom() {


		},
		methods: {
			getdata() {
				var openid = this.openid
				var type = this.current + 1
				uni.request({
					url: this.$BASE_URL +
						'/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=goods.get_list&keywords=&isrecommand=&ishot=&isnew=&isdiscount=&issendfree=&istime=&order=&by=&merchid=&page=1&cate=' +
						this.cate,

					success: res => {
						var data = res.data
						var code = data.error
						
						this.data_list=data.result.list
						console.log(this.data_list);

					},
					fail: () => {},
					complete: () => {
						uni.hideLoading();
					}
				});
			},
			to_detail(value){
				var goodsid=value.id
				uni.navigateTo({
					url: '/pages/goods/detail?goodsid=' +goodsid+'&type=smyq'
				});
			},
		}
	}
</script>

<style lang="less">
	*{
		margin: 0;
		padding: 0;
	}
	page {
		height: 100%;
		
		
	}

	.container {
		height: 100%;
		overflow: auto;
		padding: 0 15px;
		padding-bottom: 104px;
		box-sizing: border-box;
		background: url('/static/images/home/msgoods_bg.png') center -70rpx no-repeat;
		background-size: 100% 106%;
	}

	.list_box {
		display: flex;
		flex-wrap: wrap;
		align-content: flex-start;

		.item {
			width: 49%;
			margin-bottom: 15px;

			.bgi_box {
				background: url('/static/images/home/sm_goods_bg.png') 0 0 no-repeat;
				background-size: 100% 100%;
				width: 100%;
				height: 176px;

				display: block;
				padding: 15px;
				box-sizing: border-box;
				position: relative;

				image {
					width: calc(100% - 30px);
					height: calc(100% - 30px);
					// width:100%;
					// height: 100%;
					display: block;
					position: absolute;
					top: 0;
					left: 0;
					bottom: 0;
					right: 0;
					margin: auto;
				}
			}

			.content_box {
				width: 100%;

				.row1 {
					font-weight: 700;
					color: #000;
					padding: 3px 5px;
					line-height: 1;
				}

				.row2,
				.row3 {
					display: flex;
					align-items: center;
					

					view {
						// width: 50%;
					}
				}

				.row4 {
					display: flex;
				}

				.row5 {
					color: #ca0000;
					border: 1px solid #f281aa;
					display: flex;
					justify-content: space-between;
					.price {}

					.buy_button {
						height: 26px;
						background: #e60041;
						color: #fff;
						display: flex;
						align-items: center;
						justify-content: center;
						font-size: 12px;
						padding: 0 10px;
					}
				}
			}

		}
	}
</style>